package 字符串;

/**
 * @author 帅小伙
 * @date 2021/12/30
 * @description
 */
public class Demo09JZ73反转单词序列 {


    public String ReverseSentence(String str) {
        StringBuffer sb = new StringBuffer();

        String[] strings = str.split(" ");
        for (int i = strings.length - 1; i >= 0; i--) {
            sb.append(strings[i]);
        }


        return sb.toString().trim();
    }
}
